package com.ylr.config.framework.feign.client;

import com.ylr.config.common.dto.mapping.SimpleMappingDto;
import com.ylr.base.common.tool.Result;
import com.ylr.config.framework.feign.YcMappingBaseClient;
import com.ylr.config.framework.feign.configuration.ClientConfiguration;
import com.ylr.config.framework.feign.fallback.YcMappingClientFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * Created by IntelliJ IDEA.
 *
 * @author wyw
 * date: 2023-05-03 17:59:32
 * className: YcMappingClient 键值对映射客户端接口
 * version: 1.0
 * description:
 */
@FeignClient(value = "ylr-config", contextId = "YcMappingClient", path = "/api/mapping",
        fallback = YcMappingClientFallback.class, configuration = ClientConfiguration.class)
public interface YcMappingClient extends YcMappingBaseClient {

    /**
     * 获取键值对映射接口
     * @param key 键
     * @return 键值对映射数据
     */
    @GetMapping("/find")
    Result<SimpleMappingDto> getMapping(@RequestParam("key") String key);

}
